public class Test8_ReThrowInterruptException {
    public static void main(String[] args) throws InterruptedException {
        //当前线程
        Thread thread=Thread.currentThread();
        try {
            //检测当前线程是否被中断
            thread.interrupt();
            //线程休眠3秒
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            System.out.println(thread.getName()+"抛出InterException中断异常");
            System.out.println(thread.getName()+"做一些清理工作");
            throw e;
        }
        System.out.println("主程序能正常运行吗？");
    }
}
